package com.ynny.list01.example01;

import com.ynny.list01.Student;
import com.ynny.list01.service.StudentService;

import java.util.ArrayList;
import java.util.Scanner;

public class StudentManagerDemo03 {//学生管理案例2
    StudentService studentService = new StudentService();
    Scanner scanner = new Scanner(System.in);

    public static void main(String[] args) {
        StudentManagerDemo03 studentManagerDemo03 = new StudentManagerDemo03();
        studentManagerDemo03.init();
    }


    private void init(){
        while (true){
            System.out.println("请选择1.录入\t0.退出");
            int choice = scanner.nextInt();
            if (choice == 1){
                studentService.add();
            } else if (choice == 0) {
                studentService.printStudent();
                scanner.close();
                break;
            }
        }
    }


}
